package de.uni_potsdam.hpi.bpt.ai.collection;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

import org.json.JSONException;

import de.uni_potsdam.hpi.bpt.ai.diagram.Diagram;
import de.uni_potsdam.hpi.bpt.ai.diagram.DiagramBuilder;

public interface Revision extends Comparable<Revision> {

	/**
	 * Calls the {@link DiagramBuilder} from the Oryx diagram API to create an {@link Diagram} 
	 * from the file found in the directory tree.
	 * @return the {@link Diagram} representation of this revision
	 * @throws JSONException if the json file found is not a valid oryx json
	 * @throws UnsupportedEncodingException if it fails to read the json file as UTF8
	 * @throws FileNotFoundException if the json file does not exist
	 * @throws IOException if there is some error during reading
	 */
	public abstract Diagram getDiagram() throws JSONException,
			UnsupportedEncodingException, FileNotFoundException, IOException;

	/**
	 * Get the {@link File} representation of the json
	 * @return the {@link File json}
	 */
	public abstract File getJson();

	/**
	 * Get the revision number assign to this revision
	 * @return {@link Integer revision number}
	 */
	public abstract Integer getNumber();

	/**
	 * Get the {@link File} representation of the svg
	 * @return the {@link File svg}
	 */
	public abstract File getSvg();

}